/*
 * temp_plot.h
 *
 *  Created on: 22.07.2013
 *      Author: SpirTanol
 */

#ifndef TEMP_PLOT_H_
#define TEMP_PLOT_H_

// QT
#include <QObject>

// Qwt
#include <qwt_plot.h>

class QwtPlotCurve;

class TempPlot : public QwtPlot
{
	Q_OBJECT

	QVector<double> oTimes;
	struct CurveData
	{
		QwtPlotCurve *oCurve;
		QVector<double> oData;
	};
	CurveData oCurves[2];
	double oLeftMax;
	double oRightMax;
	uint oDuration;

public:
	TempPlot();
	TempPlot(const TempPlot *plot);
	~TempPlot();

	void restart();
	void updateData(double temp, double calcTemp);

	inline void setDuration(uint duration) { oDuration = duration; }
	inline uint duration() const { return oDuration; }

private:
	void init();

private slots:
	void showCurve(QwtPlotItem *, bool on);

};

#endif /* TEMP_PLOT_H_ */
